<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="../../../resources/templates/login.xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:sec="http://www.springframework.org/security/facelets/tags" >


    <ui:define name="menu_horizontal">
        <sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_FUNC">
            <ui:include src="/pages/site/funcionario/menu.xhtml" />
        </sec:ifAnyGranted>
    </ui:define>
    
    <ui:define name="corpo">
        <style type="text/css">
            .semBorda tr, .semBorda td {  
                border: none !important;  
            }
        </style>
        <sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_FUNC">
            <h:form>
                <p:fieldset legend="Remoção de Imagens">
                    <p:dataTable id="tabela" var="p" value="#{controllerGaleria.listaDM}" paginator="true" rows="5" 
                               paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
                               rowsPerPageTemplate="5,10,15"       emptyMessage="Nada encontrado...">
                        <p:column headerText="Opções" >
                            <p:commandButton value="Excluir" actionListener="#{controllerGaleria.remover()}" update="@form" process="@this"/>
                        </p:column>
                        <p:column headerText="Caminho">
                            <h:outputText  value="#{p.foto}"/>
                        </p:column>
                        <p:column headerText="Imagem" width="200">
                            <p:graphicImage value="../../../#{p.foto}" width="200" height="150"/>
                        </p:column>
                        
                        
                        
                    </p:dataTable>                
                </p:fieldset>
            </h:form>
            
        </sec:ifAnyGranted>
    </ui:define>



</ui:composition>